<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>Document</title>
</head>

<body>

请打开F12

<div id="qrcode">
</div>
<script src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>

<script>
    function wechatPayNative() {

        $.ajax({
            type: "post",
            url: "https://www.dcdev.net/lib/lib_of_back_end/v1.0.1/api/tencent/mp/mp_pay_native_config.php",
            data: {
                params: JSON.stringify({
                    "pid": '0000000000000000',
                    "uid": "7cfd733cfa9a5ec7",
                    "body": "商品描述",
                    "total_fee": "0.01"
                })
            },
            success: function (res) {
                var obj = JSON.parse(res);
                if (obj.res === 1) {
                    var data = obj.data;
                    jQuery('#qrcode').qrcode(data.code_url);

                    checkPayStatus(data.order_id);

                } else {
                    alert(obj.desc);
                }
            }
        });

    }

    wechatPayNative();


    function checkPayStatus(orderId) {
        setInterval(function () {
            $.ajax({
                type: "post",
                url: "https://www.dcdev.net/lib/lib_of_back_end/v1.0.1/api/dcdev/system/get_order_status.php",
                data: {
                    params: JSON.stringify({
                        "pid": "0000000000000000",
                        "order_id": orderId,
                        "uid": "7cfd733cfa9a5ec7"
                    })
                },
                success: function (res) {
                    var obj = JSON.parse(res);
                    if (obj.res === 1) {
                        if (obj.data.status == 1) {
                            alert('支付成功');
                        } else {
                            console.log('订单未支付');
                        }
                    } else {
                        alert(obj.desc);
                    }
                }
            });
        }, 2000);
    }
</script>

</body>
</html>